﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;

namespace GeneratorCustomization
{
    /// <summary>
    /// Description of TableRelationship...
    /// </summary>
    public class TableRelationship
    {
        /// <summary>
        /// Gets and set the DatabaseName
        /// </summary>
        public string DatabaseName { get; set; }
        /// <summary>
        /// Gets and set the TableOneName
        /// </summary>
        public string TableOneName { get; set; }
        /// <summary>
        /// Gets and set the TableTwoName
        /// </summary>
        public string TableTwoName { get; set; }
        /// <summary>
        /// Gets and set the Relationship
        /// </summary>
        public string Relationship { get; set; }
        /// <summary>
        /// Gets and set the Behaviour
        /// </summary>
        public string Behaviour { get; set; }

        #region Constructors and Simple Factories
        /// <summary>
        /// Private Constructor. Use the Build method externally.
        /// </summary>
        private TableRelationship(DataRow row)
        {
            DatabaseName = row["Database"].ToString();
            TableOneName = row["TableOneName"].ToString();
            TableTwoName = row["TableTwoName"].ToString();
            Relationship = row["Relationship"].ToString();
            Behaviour = row["Behaviour"].ToString();
        }

        /// <summary>
        /// Instantiate a new TableRelationship
        /// </summary>
        public static TableRelationship Build(DataRow row)
        {
            return new TableRelationship(row);
        }
        #endregion

    }
}
